home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / compass.zip / COMPASS.QC < prev    next >
Text File  |  1996-09-19  |  649b  |  34 lines

  1. /*
  2. ============
  3. Display Compass
  4.  
  5. ============
  6. */
  7. void() DisplayCompass =
  8. {
  9.     local float dir;
  10.     local string str;
  11.  
  12.         dir = self.v_angle_y;
  13.     if (dir > -22.5 && dir <= 22.5)
  14.         str = "North";
  15.     else if (dir > 22.5 && dir <= 67.5)
  16.         str = "Northwest";
  17.     else if (dir > 67.5 && dir <= 112.5)
  18.         str = "West";
  19.     else if (dir > 112.5 && dir <= 157.5)
  20.         str = "Southwest";
  21.     else if (dir > 157.5 || dir <= -157.5)
  22.         str = "South";
  23.     else if (dir > -157.5 && dir <= -112.5)
  24.         str = "Southeast";
  25.     else if (dir > -112.5 && dir <= -67.5)
  26.         str = "East";
  27.     else 
  28.         str = "Northeast";
  29.  
  30.     sprint(self, "Your are looking ");
  31.     sprint(self, str);
  32.     sprint(self, "\n");
  33. };
  34.